.tv-home-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: #0a0a0a;
  color: white;
  font-family: 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
}

.background-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: -1;
  animation: gradientShift 15s ease infinite;
  background-size: 400% 400%;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.tv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1.5rem, 4vw, 3rem);
  background-color: rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-logo {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: bold;
  color: #4a90e2;
  text-shadow: 0 0 10px rgba(74, 144, 226, 0.7);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav button {
  background: none;
  border: none;
  color: #aaa;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  padding: clamp(0.3rem, 1vw, 0.5rem) clamp(1rem, 2vw, 1.5rem);
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 4px;
}

.header-nav button:hover, 
.header-nav button:focus,
.header-nav button.active {
  color: white;
  background-color: rgba(74, 144, 226, 0.3);
  outline: none;
}

.header-nav button.active {
  color: white;
  background-color: rgba(74, 144, 226, 0.5);
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

.tv-main-content {
  flex: 1;
  padding: clamp(0.5rem, 2vw, 1rem) clamp(1.5rem, 4vw, 3rem);
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.tv-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
  color: white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  text-align: center;
}

.game-carousel {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: visible;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  height: 100%;
  flex: 1;
  min-height: 0;
  perspective: 1000px;
  padding: 2rem 0;
}

.game-card {
  position: absolute;
  width: clamp(250px, 30vw, 400px);
  height: clamp(300px, 40vh, 450px);
  background-color: rgba(42, 42, 42, 0.9);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  left: 50%;
  transform-origin: center;
  will-change: transform, opacity, filter;
}

.game-card.active {
  transform: translate(-50%, 0) scale(1.05);
  opacity: 1;
  z-index: 5;
  box-shadow: 0 0 30px rgba(74, 144, 226, 0.7);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3)) !important;
  position: absolute;
  left: 50%;
}

.game-card.active::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(42, 42, 42, 0.9);
  border-radius: 16px;
  transform: scaleY(-0.6);
  transform-origin: bottom;
  opacity: 0.25;
  filter: blur(3px);
  mask: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 40%, transparent 80%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 40%, transparent 80%);
  z-index: -1;
  pointer-events: none;
}

.game-card.left-1 {
  transform: translate(-120%, 0) scale(0.9);
  opacity: 0.9;
  z-index: 4;
  filter: blur(1px);
}

.game-card.left-2 {
  transform: translate(-180%, 0) scale(0.8);
  opacity: 0.7;
  z-index: 3;
  filter: blur(2px);
}

.game-card.right-1 {
  transform: translate(20%, 0) scale(0.9);
  opacity: 0.9;
  z-index: 4;
  filter: blur(1px);
}

.game-card.right-2 {
  transform: translate(80%, 0) scale(0.8);
  opacity: 0.7;
  z-index: 3;
  filter: blur(2px);
}

.game-card.far {
  opacity: 0.3;
  transform: translateX(-50%) scale(0.5);
  z-index: 1;
  display: block;
  filter: blur(3px);
}

.game-card.left-3 {
  transform: translate(-240%, 0) scale(0.7);
  opacity: 0.6;
  z-index: 2;
  filter: blur(2.5px);
}

.game-card.right-3 {
  transform: translate(140%, 0) scale(0.7);
  opacity: 0.6;
  z-index: 2;
  filter: blur(2.5px);
}

.card-image {
  width: 100%;
  height: 60%;
  background-size: cover;
  background-position: center;
}

.card-content {
  padding: clamp(0.8rem, 2vw, 1.5rem);
  height: 40%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  margin: 0 0 0.5rem;
  color: white;
  line-height: 1.2;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  color: #aaa;
}

.game-card:focus {
  outline: 3px solid #4a90e2;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .tv-home-container {
    height: 100vh;
    overflow-y: auto;
  }
  
  .tv-header {
    padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 3vw, 1.5rem);
  }
  
  .header-logo {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
  }
  
  .header-nav {
    gap: 0.5rem;
  }
  
  .header-nav button {
    font-size: clamp(0.8rem, 2vw, 1rem);
    padding: clamp(0.3rem, 1vw, 0.4rem) clamp(0.5rem, 2vw, 0.8rem);
  }
  
  .tv-main-content {
    padding: clamp(0.5rem, 2vw, 1rem);
  }
  
  .tv-title {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-bottom: clamp(0.5rem, 2vw, 0.8rem);
  }
  
  .game-carousel {
    height: clamp(200px, 30vh, 300px);
    margin-bottom: clamp(0.5rem, 2vw, 0.8rem);
  }
  
  .game-card {
    width: clamp(160px, 35vw, 220px);
    height: clamp(180px, 30vh, 250px);
  }
  
  .game-card.left-1 {
    transform: translateX(-130%) scale(0.8);
    filter: blur(1px);
  }

  .game-card.left-2 {
    transform: translateX(-200%) scale(0.65);
    filter: blur(2px);
  }

  .game-card.right-1 {
    transform: translateX(30%) scale(0.8);
    filter: blur(1px);
  }

  .game-card.right-2 {
    transform: translateX(100%) scale(0.65);
    filter: blur(2px);
  }
  
  .card-content {
    padding: clamp(0.5rem, 2vw, 1rem);
  }
  
  .card-title {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  }
  
  .card-meta {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  }
}

@media (max-width: 480px) {
  .tv-header {
    flex-direction: column;
    gap: 0.5rem;
    padding: clamp(0.5rem, 2vw, 0.8rem);
  }
  
  .header-nav {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .game-carousel {
    height: clamp(180px, 25vh, 250px);
  }
  
  .game-card {
    width: clamp(140px, 40vw, 180px);
    height: clamp(160px, 25vh, 200px);
  }
  
  .game-card.left-1, .game-card.right-1 {
    opacity: 0.6;
    transform: translateX(-50%) scale(0.7);
    filter: blur(1.5px);
  }
  
  .game-card.left-2, .game-card.right-2 {
    display: none;
  }
  
  .card-title {
    font-size: clamp(0.8rem, 3vw, 1rem);
    line-height: 1.1;
  }
  
  .card-meta {
    font-size: clamp(0.6rem, 2vw, 0.8rem);
  }
}

@media (max-height: 600px) {
  .tv-header {
    padding: clamp(0.3rem, 1vh, 0.8rem) clamp(1rem, 3vw, 1.5rem);
  }
  
  .tv-main-content {
    padding: clamp(0.3rem, 1vh, 0.8rem) clamp(1rem, 3vw, 1.5rem);
  }
  
  .tv-title {
    font-size: clamp(1rem, 3vh, 1.5rem);
    margin-bottom: clamp(0.3rem, 1vh, 0.5rem);
  }
  
  .game-carousel {
    height: clamp(150px, 25vh, 200px);
  }
  
  .game-card {
    height: clamp(140px, 22vh, 180px);
  }
}

@media (min-width: 769px) and (max-width: 1199px) {
  .game-card.left-1 {
    transform: translateX(-170%) scale(0.9);
    filter: blur(1px);
  }

  .game-card.left-2 {
    transform: translateX(-260%) scale(0.8);
    filter: blur(2px);
  }

  .game-card.right-1 {
    transform: translateX(70%) scale(0.9);
    filter: blur(1px);
  }

  .game-card.right-2 {
    transform: translateX(160%) scale(0.8);
    filter: blur(2px);
  }
}

.room-prompt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.room-prompt-modal {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.room-prompt-modal h2 {
  color: #4a90e2;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.room-prompt-modal p {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.room-info {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1rem;
  margin: 1.5rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-info p {
  margin: 0.5rem 0;
  font-size: 1rem;
  color: #e0e0e0;
}

.room-info strong {
  color: #4a90e2;
}

.room-prompt-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.connect-btn, .cancel-btn {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.connect-btn {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.connect-btn:hover {
  background: linear-gradient(135deg, #357abd 0%, #2968a3 100%);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
  transform: translateY(-2px);
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .room-prompt-modal {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .room-prompt-modal h2 {
    font-size: 1.5rem;
  }
  
  .room-prompt-buttons {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .connect-btn, .cancel-btn {
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .game-card.left-1 {
    transform: translate(-120%, 0) scale(0.9);
    opacity: 0.9;
    z-index: 4;
    filter: blur(1px);
  }

  .game-card.left-2 {
    transform: translate(-180%, 0) scale(0.8);
    opacity: 0.7;
    z-index: 3;
    filter: blur(2px);
  }

  .game-card.right-1 {
    transform: translate(20%, 0) scale(0.9);
    opacity: 0.9;
    z-index: 4;
    filter: blur(1px);
  }

  .game-card.right-2 {
    transform: translate(80%, 0) scale(0.8);
    opacity: 0.7;
    z-index: 3;
    filter: blur(2px);
  }
}

@media (min-width: 1920px) {
  .game-card.left-1 {
    transform: translateX(-180%) scale(0.9);
    filter: blur(1px);
  }

  .game-card.left-2 {
    transform: translateX(-280%) scale(0.8);
    filter: blur(2px);
  }

  .game-card.right-1 {
    transform: translateX(80%) scale(0.9);
    filter: blur(1px);
  }

  .game-card.right-2 {
    transform: translateX(180%) scale(0.8);
    filter: blur(2px);
  }
}
